package com.ak.common.enums;

/**
  * 系统参数  枚举
 * @author dvean
 *
 */
public class Enums {

    public enum RandomType {
        INT, STRING, ALL
    }

    /**
          * 数据库类型
     */
    public enum DatabaseType implements EnumFacade {
        MYSQL("com.mysql.cj.jdbc.Driver", "MySQL"), ORACLE("oracle.jdbc.driver.OracleDriver", "Oracle");
        private final String code;
        private final String info;
        DatabaseType(String code, String info) {
            this.code = code;
            this.info = info;
        }
        @Override
        public String getCode() {
            return code;
        }
        @Override
        public String getInfo() {
            return info;
        }
    }

    /**
          * 数据库标识
     */
    public enum DatabaseFlag implements EnumFacade {
        MAIN("M", "主库"), WRITE("W", "写入库"), ORACLE("R", "查询库");
        private final String code;
        private final String info;
        DatabaseFlag(String code, String info) {
            this.code = code;
            this.info = info;
        }
        @Override
        public String getCode() {
            return code;
        }
        @Override
        public String getInfo() {
            return info;
        }
    }

    /**
     * 0：停用；1正常：
     */
    public enum Status implements EnumFacade {
        DISABLE("0", "停用"), OK("1", "正常");
        private final String code;
        private final String info;
        Status(String code, String info) {
            this.code = code;
            this.info = info;
        }
        @Override
        public String getCode() {
            return code;
        }
        @Override
        public String getInfo() {
            return info;
        }
    }

    /**
     * 0：存在；1：删除
     */
    public enum DelFlag implements EnumFacade {
        EXIST("0", "存在"), DEL("1", "删除");
        private final String code;
        private final String info;
        DelFlag(String code, String info) {
            this.code = code;
            this.info = info;
        }
        @Override
        public String getCode() {
            return code;
        }
        @Override
        public String getInfo() {
            return info;
        }
    }

    /**
     * 0：女；1：男；2：保密
     */
    public enum Sex implements EnumFacade {
        FEMALE("0", "女"), MALE("1", "男"), UNKNOW("2", "保密");
        private final String code;
        private final String info;
        Sex(String code, String info) {
            this.code = code;
            this.info = info;
        }
        @Override
        public String getCode() {
            return code;
        }
        @Override
        public String getInfo() {
            return info;
        }
    }

    /**
     * 0：失败；1：成功；
     */
    public enum SuccessOrFail implements EnumFacade {
        SUCCESS("1", "成功"), FAIL("0", "失败");
        private final String code;
        private final String info;
        SuccessOrFail(String code, String info) {
            this.code = code;
            this.info = info;
        }
        @Override
        public String getCode() {
            return code;
        }
        @Override
        public String getInfo() {
            return info;
        }
    }
}
